<?php
/**
 * AccountAgentTotalDao
 * 
 * @desc use for `account_agent_totals`
 * @author by fusq
 */

require_once ('../app/core/models/BaseDao.php');

class AccountAgentTotalDao extends BaseDao {
	
	private $tableName = 'account_agent_totals';
	
	public function __construct($dbUtil){
        parent::__construct($dbUtil);
        $this->_name = $this->tableName;
    } 
	
	public function getAccountAgentTotalByUserId($userId){
		$sql = "select * from $this->tableName where user_id = ? and is_delete = 0";
		$parms = array($userId);
		return $this->dbUtil->SelectData( $sql, $parms );
	}
	
	public function updateAccountAgentTotal($data,$id){
        $where = " id = $id";
        return $this->update($data,$where);		
	}
}